package com.zgjkhis.modules.basicsetting.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author yzq
 * @Description 治疗项目 套餐详情
 * @Date 2021/6/23 9:38
 * @Param
 * @return
 **/
@Data
@TableName("his_treatment_detail")
public class TreatmentDetail implements Serializable {

    @TableId
    private Long id;
    @ApiModelProperty(value = "项目名称")
    private String projectName;
    @ApiModelProperty(value = "单位")
    private String company;
    @ApiModelProperty(value = "零售价")
    private BigDecimal salePrice;
    @ApiModelProperty(value = "成本价")
    private BigDecimal costPrice;
    @ApiModelProperty(value = "备注")
    private  String remark;
    @ApiModelProperty(value = "允许折扣，0：是，1：否")
    private Integer isDiscount;
    @ApiModelProperty(value = "允许自由定价：0：是，1：否")
    private Integer freePrice;
    @ApiModelProperty(value = "是否为套餐：0：是，1：否")
    private Integer isPackage;
    @ApiModelProperty(value = "是否有效：0：有效，1：无效")
    private Integer type;
    @ApiModelProperty(value = "类型：1：治疗项目，2：理疗项目")
    private Integer status;
    @ApiModelProperty(value = "拼音码")
    private String py;
    @ApiModelProperty(value = "药房id")
    private String pharmacyId;
    @TableField(fill= FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;

    public void copy(TreatmentDetail source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
